import { NestFactory } from '@nestjs/core'
import { AppModule } from './app.module'
import { Response } from './interceptor/response'
import { NestExpressApplication } from '@nestjs/platform-express'
import { join } from 'path'
import { CatchFilter } from './filter/catch'

async function bootstrap() {
    const app = await NestFactory.create<NestExpressApplication>(AppModule)
    app.set('trust proxy', true)
    app.useStaticAssets(join(__dirname, 'uploadfiles'), { prefix: '/files' })
    app.useGlobalInterceptors(new Response())
    app.useGlobalFilters(new CatchFilter())
    await app.listen(3000)
}
bootstrap()
